package com.ocr;
import java.util.ArrayList;
import java.util.List;


public class B {
	
	private int[][] imageData;
	public List<Integer> imgIntList;
	public List<Integer> c;
	private int _f = 0;
	private char a;
	
	
	public List<Integer> a() {
		return this.c;
	}
	
	public int g()
    {
        return this._f;
    }
	 public char b_char()
	    {
	        return this.a;
	    }

	public B(char A_0, int[][] A_1) {
		this.a = A_0;
		this.initData(A_1);
	}
	
	
	private List<Integer> fixImgIntList(int[][] imageData) {
		List<Integer> list = new  ArrayList<Integer>();
		int num3 = 0;
		for (int i = 0; i < imageData.length; i++) {
			list.add(0);
			for (int j = 0; j < imageData[i].length; j++) {
				num3 = list.get(i)+(Integer.parseInt(imageData[i][j]+"") * (Integer.parseInt(""+(int)Math.pow(2.0, (double) ((imageData[i].length - 1) - j)))));
				list.set(i, num3);
			}
		}
		return list;
	}
	
	
	 private List<Integer> b_get_property_list(int[][] imageData) {
	        List<Integer> list = new ArrayList<Integer>();
	        for (int i = 0; i < imageData[0].length; i++)
	        {
	            list.add(0);
	            for (int j = 0; j < imageData.length; j++)
	            {
	                int num3 = list.get(i)+(Integer.parseInt(imageData[j][ i]+"") * (Integer.parseInt(""+(int)Math.pow(2.0, (double) ((imageData.length - 1) - j)))));
	                list.set(i, num3);
	               
	                if (imageData[j][i] == 1)
	                {
	                    this._f++;
	                }
	            }
	        }
	        return list;
	    }
	
	private void initData(int[][] imageData) {
		this.imageData = imageData;
		imgIntList = new ArrayList<Integer>();
		imgIntList = fixImgIntList(imageData);
		c = new ArrayList<Integer>();
		c = b_get_property_list(imageData);
		
	} 
	
	public int count() {
		return imageData.length;
	}
	
	 public int d() {
	     return this.imageData[0].length;
	}
	
	public B(int[][] imageData) {
		this.initData(imageData);
	}

}
